centos nexus启动 nexus linux 您所在的位置:网站首页 nexus 启动报错 centos nexus启动 nexus linux

centos nexus启动 nexus linux

2024-06-08 00:44| 来源: 网络整理| 查看: 265

Linux搭建nexus仓库1.安装jdk1.1 获取安装包,解压到指定目录:1 tar xf jdk.tar.gz -C /opt/export1.2 配置环境变量:1 # vim /etc/profile 2 export JAVA_HOME=/opt/export/jdk 3 export PATH=$JAVA_HOME/bin:$PATH 4 export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar 5 export RUN_AS_USER=root # 后边启动nexus需要 6 7 # source /etc/profile1.3 出现下面结果,说明部署成功1 # java -version 2 java version "1.7.0_80" 3 Java(TM) SE Runtime Environment (build 1.7.0_80-b15) 4 Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)2.安装nexus2.1下载安装

下载地址:

https://www.sonatype.com/download-oss-sonatypehttps://help.sonatype.com/repomanager2/download/download-archives---repository-manager-oss

1 cd /opt 2 tar xf nexus-2.4.0-09-bundle.tar.gz

解压后有两个目录:

1 $ ls /opt/ 2 nexus-2.4.0-09 sonatype-work

更改目录名称:

1 mv nexus-2.4.0-09 nexus2.2 更改nexus配置文件

默认端口为8081,可根据需要修改:

1 $ vim /opt/nexus/conf/nexus.properties 2 # Jetty section 3 application-port=8081 # 修改为10890 4 application-host=0.0.0.0 5 nexus-webapp=${bundleBasedir}/nexus 6 nexus-webapp-context-path=/nexus 7 8 # Nexus section 9 nexus-work=${bundleBasedir}/../sonatype-work/nexus 10 runtime=${bundleBasedir}/nexus/WEB-INF2.3 关闭防火墙或打开10890端口1 /etc/init.d/iptables stop 2 chkconfig iptables off2.4 启动nexus1 $ /opt/nexus/bin/jsw/linux-x86-64/nexus start 2 **************************************** 3 WARNING - NOT RECOMMENDED TO RUN AS ROOT 4 **************************************** 5 Starting Nexus OSS... 6 Started Nexus OSS.

如果没有配置环境变量RUN_AS_USER=root,会报错:

1 # /opt/nexus/bin/jsw/linux-x86-64/nexus start 2 **************************************** 3 WARNING - NOT RECOMMENDED TO RUN AS ROOT 4 **************************************** 5 If you insist running as root, then set the environment variable RUN_AS_USER=root before running this script.2.5 检查进程和端口 

centos nexus启动 nexus linux_bundle

 3.浏览器访问nexus1 http://ip地址:8081/nexus 2 登录,默认用户名 admin 默认密码 admin123

 访问登录:

centos nexus启动 nexus linux_JAVA_02

4.迁移nexus

如果想要将nexus仓库迁移,只需要打包此目录,迁移到新nexus主机:

1 $ du -sh /opt/sonatype-work/nexus/storage 2 47G /opt/sonatype-work/nexus/storage/

由于文件过大,可采用rsync的方式。

本文参考:

Nexus高可用方案

描述:由于nexus进程会因为某些原因挂掉,为了不影响使用,决定做nexus高可用。

准备:根据上一章,准备两台服务器搭建nexus,主:192.168.51.204 maven01,备:192.168.51.207 maven02:

1.搭建keepalived

主:

1 # cat /etc/keepalived/keepalived.conf 2 ! Configuration File for keepalived 3 4 global_defs { 5 router_id maven01 6 } 7 vrrp_script chk_http_port { #检测nexus端口是否存在,不存在进行vip漂移 8 script "


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有